﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Home.Master" AutoEventWireup="true" CodeBehind="TimeWeek.aspx.cs" Inherits="TimeWork.TimeWeek" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Bredcrumb" runat="server">
    <li><a href="#" class="report">Đăng ký thời gian</a></li>>
    <li><a href="#">Đăng ký theo tuần</a></li>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <form id="timeweek" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

    <script type="text/javascript">
        function ShowComment(xxx) {
            alert(xxx);
        }
    </script>
    <div class="info-box" style="width:auto;">
                <h3>Đăng ký thời gian theo tuần</h3>
                <table>
                    <tr>
                        <td class="tdLabel" style="width: 115px;"><%--Tên:--%></td>
                        <td align="left" valign="top"  style="width: 415px;"><asp:Label ID="lblName" 
                                runat="server" Visible="False"></asp:Label></td>
                        <td align="right" valign="top">Chọn tuần:</td>
                        <td rowspan="5" style="vertical-align: top; width: 250px;" align="center">
                            <asp:Calendar ID="Calendar" runat="server" BackColor="#FFFFCC" 
                                BorderColor="#FFCC66" BorderWidth="1px" DayNameFormat="Shortest" 
                                Font-Names="Verdana" Font-Size="8pt" ForeColor="#663399" Height="200px" 
                                ShowGridLines="True" Width="220px" 
                                FirstDayOfWeek="Monday" ondayrender="Calendar_DayRender" 
                                onselectionchanged="Calendar_SelectionChanged">
                                <DayHeaderStyle BackColor="#FFCC66" Font-Bold="True" Height="1px" />
                                <NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC" />
                                <OtherMonthDayStyle ForeColor="#CC9966" />
                                <SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
                                <SelectorStyle BackColor="#FFCC66" />
                                <TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt" 
                                    ForeColor="#FFFFCC" />
                                <TodayDayStyle BackColor="#FFCC66" ForeColor="White" />
                            </asp:Calendar>
                        </td>
                    </tr>
                    <tr>
                        <td class="tdLabel"><%--Email:--%></td>
                        <td colspan="2" align="left" valign="top"><asp:Label ID="lblEmail" runat="server" 
                                Visible="False"></asp:Label></td>
                    </tr>
                    <tr>
                        <td class="tdLabel">Thời gian đăng ký:</td>
                        <td colspan="2" align="left" valign="top"><asp:Label ID="lblDateRegister" 
                                runat="server" Font-Bold="True" ForeColor="Maroon"></asp:Label></td>
                    </tr>
                    <tr>
                        <td colspan="3"><br /><br />
                            <br />
                            <br /><br /></td>
                    </tr>
                    <tr>
                        <td colspan="4"><strong>Công việc:</strong><br />
                        
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                <ContentTemplate> 
                                    <asp:DropDownList ID="ddlCode1" runat="server" AutoPostBack="True" 
                                        CssClass="round-border" onselectedindexchanged="ddlCode1_SelectedIndexChanged">
                                    </asp:DropDownList>
                                    <asp:DropDownList ID="ddlCode2" runat="server" AutoPostBack="True" 
                                        CssClass="round-border" onselectedindexchanged="ddlCode2_SelectedIndexChanged">
                                    </asp:DropDownList> 
                                    <asp:DropDownList ID="ddlCode3" runat="server" AutoPostBack="True" 
                                        CssClass="round-border" onselectedindexchanged="ddlCode3_SelectedIndexChanged">
                                    </asp:DropDownList>&nbsp;
                                    <asp:DropDownList ID="ddlCode4" runat="server" CssClass="round-border">
                                    </asp:DropDownList>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                            <asp:Button ID="btnAdd" runat="server" Text="Thêm mới" CssClass="mybutton" 
                                onclick="btnAdd_Click"/>
                        </td>
                    </tr>
                </table>
                
                <table class="in-border info-box1">
                    <tr>
                        <td align="left" style="width: 866px;">
                        <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                            <Triggers>
                                
                            </Triggers>
                            <ContentTemplate> 
                                <asp:GridView ID="gvRegisterWeek" runat="server" AutoGenerateColumns="false" 
                                    ShowFooter="True" ShowHeaderWhenEmpty="True" 
                                    onrowdatabound="gvRegisterWeek_RowDataBound">
                                    <Columns>
                                        
                                        <asp:TemplateField HeaderStyle-Width="175" HeaderText="Tên sản phẩm" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91">
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblProjectName" Text='<%# Eval("ProjectName") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:TemplateField FooterStyle-HorizontalAlign="Right" HeaderStyle-Width="295" HeaderText="Tên công việc" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91">
                                            <ItemTemplate>
                                                <asp:Label ID="lblActivityID" runat="server" Text='<%# Eval("SAActivityID") %>' Visible="False"></asp:Label>
                                                <asp:Label runat="server" ID="lblActivityName" Text='<%# Eval("ActivityName") %>'></asp:Label>
                                            </ItemTemplate>
                                            <FooterTemplate>
                                                <asp:Label ID="lblSumTime" runat="server" Text="Tổng thời gian:" ForeColor="Maroon" Font-Bold="True"></asp:Label>
                                                
                                            </FooterTemplate>
                                        </asp:TemplateField>
 
                                        <asp:TemplateField FooterStyle-HorizontalAlign="Center" HeaderStyle-Width="55" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91" ItemStyle-HorizontalAlign="Center">
                                            <HeaderTemplate>
                                                <asp:Label ID="lblMon" runat="server" Text='<%# GetDate().mon %>'></asp:Label>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="lblIDMon" runat="server" Text='<%# Eval("SIDMon") %>' CssClass="hidden"></asp:Label>
                                                <asp:Label ID="lblTimeMon" runat="server" Text='<%# GetDate().mon %>' CssClass="hidden"></asp:Label> 
                                                <asp:HiddenField ID="hdMon" runat="server" Value='<%# Eval("ComMon") %>' />                                                                                           
                                                <asp:TextBox ID="txtTimeReportMon" runat="server" Width="35px" Text='<%# Eval("MonH") %>'></asp:TextBox>
                                                <asp:MaskedEditExtender InputDirection="LeftToRight" ID="MaskedEditExtenderMon" runat="server" TargetControlID="txtTimeReportMon" Enabled="True" Mask="99:99" MaskType="Time" UserTimeFormat="TwentyFourHour"/>
                                                <asp:MaskedEditValidator ID="MaskedEditValidatorMon" runat="server"
                                                ControlExtender="MaskedEditExtenderMon" ControlToValidate="txtTimeReportMon"
                                                ValidationGroup="Register" Display="Dynamic"
                                                InvalidValueMessage="*" IsValidEmpty="True" TooltipMessage="*" CssClass="fail" />     
                                            </ItemTemplate>
                                            <FooterTemplate>
                                                <asp:Label ID="lblSumMon" runat="server" Text="0" Font-Bold="True" ForeColor="Maroon"></asp:Label>
                                                
                                            </FooterTemplate>
                                        </asp:TemplateField>

                                        
                                        <asp:TemplateField FooterStyle-HorizontalAlign="Center" HeaderStyle-Width="55" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91" ItemStyle-HorizontalAlign="Center">
                                            <HeaderTemplate>
                                                <asp:Label ID="lblTue" runat="server" Text='<%# GetDate().tue %>'></asp:Label>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="lblIDTue" runat="server" Text='<%# Eval("SIDTue") %>' CssClass="hidden"></asp:Label>
                                                <asp:HiddenField ID="hdTue" runat="server" Value='<%# Eval("ComTue") %>' /> 
                                                <asp:Label ID="lblTimeTue" runat="server" Text='<%# GetDate().tue %>' CssClass="hidden"></asp:Label> 
                                                <asp:TextBox ID="txtTimeReportTue" runat="server" Width="35px" Text='<%# Eval("TueH") %>'></asp:TextBox>
                                                <asp:MaskedEditExtender InputDirection="LeftToRight" ID="MaskedEditExtenderTue" runat="server" TargetControlID="txtTimeReportTue" Enabled="True" Mask="99:99" MaskType="Time" UserTimeFormat="TwentyFourHour"/>
                                                <asp:MaskedEditValidator ID="MaskedEditValidatorTue" runat="server"
                                                ControlExtender="MaskedEditExtenderTue" ControlToValidate="txtTimeReportTue"
                                                ValidationGroup="Register" Display="Dynamic"
                                                InvalidValueMessage="*" IsValidEmpty="True" TooltipMessage="*" CssClass="fail" />
                                            </ItemTemplate>
                                            <FooterTemplate>
                                                <asp:Label ID="lblSumTue" runat="server" Text="0" Font-Bold="True" ForeColor="Maroon"></asp:Label>
                                                
                                            </FooterTemplate>
                                        </asp:TemplateField>

                                        
                                        <asp:TemplateField FooterStyle-HorizontalAlign="Center" HeaderStyle-Width="55" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91" ItemStyle-HorizontalAlign="Center">
                                            <HeaderTemplate>
                                                <asp:Label ID="lblWed" runat="server" Text='<%# GetDate().wed %>'></asp:Label>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="lblIDWed" runat="server" Text='<%# Eval("SIDWed") %>' CssClass="hidden"></asp:Label>
                                                <asp:HiddenField ID="hdWed" runat="server" Value='<%# Eval("ComWed") %>' /> 
                                                <asp:Label ID="lblTimeWed" runat="server" Text='<%# GetDate().wed %>' CssClass="hidden"></asp:Label> 
                                                <asp:TextBox ID="txtTimeReportWed" runat="server" Width="35px" Text='<%# Eval("WedH") %>'></asp:TextBox>
                                                <asp:MaskedEditExtender InputDirection="LeftToRight" ID="MaskedEditExtenderWed" runat="server" TargetControlID="txtTimeReportWed" Enabled="True" Mask="99:99" MaskType="Time" UserTimeFormat="TwentyFourHour"/>
                                                <asp:MaskedEditValidator ID="MaskedEditValidatorWed" runat="server"
                                                ControlExtender="MaskedEditExtenderWed" ControlToValidate="txtTimeReportWed"
                                                ValidationGroup="Register" Display="Dynamic"
                                                InvalidValueMessage="*" IsValidEmpty="True" TooltipMessage="*" CssClass="fail" />
                                            </ItemTemplate>
                                            <FooterTemplate>
                                                <asp:Label ID="lblSumWed" runat="server" Text="0" Font-Bold="True" ForeColor="Maroon"></asp:Label>
                                               
                                            </FooterTemplate>
                                        </asp:TemplateField>

                                        
                                        <asp:TemplateField FooterStyle-HorizontalAlign="Center" HeaderStyle-Width="55" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91" ItemStyle-HorizontalAlign="Center">
                                            <HeaderTemplate>
                                                <asp:Label ID="lblThu" runat="server" Text='<%# GetDate().thu %>'></asp:Label>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="lblIDThu" runat="server" Text='<%# Eval("SIDThu") %>' CssClass="hidden"></asp:Label>
                                                <asp:HiddenField ID="hdThu" runat="server" Value='<%# Eval("ComThu") %>' /> 
                                                <asp:Label ID="lblTimeThu" runat="server" Text='<%# GetDate().thu %>' CssClass="hidden"></asp:Label> 
                                                <asp:TextBox ID="txtTimeReportThu" runat="server" Width="35px" Text='<%# Eval("ThuH") %>'></asp:TextBox>
                                                <asp:MaskedEditExtender InputDirection="LeftToRight" ID="MaskedEditExtenderThu" runat="server" TargetControlID="txtTimeReportThu" Enabled="True" Mask="99:99" MaskType="Time" UserTimeFormat="TwentyFourHour"/>
                                                <asp:MaskedEditValidator ID="MaskedEditValidatorThu" runat="server"
                                                ControlExtender="MaskedEditExtenderThu" ControlToValidate="txtTimeReportThu"
                                                ValidationGroup="Register" Display="Dynamic"
                                                InvalidValueMessage="*" IsValidEmpty="True" TooltipMessage="*" CssClass="fail" />
                                            </ItemTemplate>
                                            <FooterTemplate>
                                                <asp:Label ID="lblSumThu" runat="server" Text="0" Font-Bold="True" ForeColor="Maroon"></asp:Label>
                                            </FooterTemplate>
                                        </asp:TemplateField>

                                        
                                        <asp:TemplateField FooterStyle-HorizontalAlign="Center" HeaderStyle-Width="55" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91" ItemStyle-HorizontalAlign="Center">
                                            <HeaderTemplate>
                                                <asp:Label ID="lblFri" runat="server" Text='<%# GetDate().fri %>'></asp:Label>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="lblIDFri" runat="server" Text='<%# Eval("SIDFri") %>' CssClass="hidden"></asp:Label>
                                                <asp:HiddenField ID="hdFri" runat="server" Value='<%# Eval("ComFri") %>' /> 
                                                <asp:Label ID="lblTimeFri" runat="server" Text='<%# GetDate().fri %>' CssClass="hidden"></asp:Label>
                                                <asp:TextBox ID="txtTimeReportFri" runat="server" Width="35px" Text='<%# Eval("FriH") %>'></asp:TextBox>

                                                <asp:MaskedEditExtender InputDirection="LeftToRight" ID="MaskedEditExtenderFri" runat="server" TargetControlID="txtTimeReportFri" Enabled="True" Mask="99:99" MaskType="Time" UserTimeFormat="TwentyFourHour"/>
                                                <asp:MaskedEditValidator ID="MaskedEditValidatorFri" runat="server"
                                                ControlExtender="MaskedEditExtenderFri" ControlToValidate="txtTimeReportFri"
                                                ValidationGroup="Register" Display="Dynamic"
                                                InvalidValueMessage="*" IsValidEmpty="True" TooltipMessage="*" CssClass="fail" />
                                            </ItemTemplate>
                                            <FooterTemplate>
                                                <asp:Label ID="lblSumFri" runat="server" Text="0" Font-Bold="True" ForeColor="Maroon"></asp:Label>
                                                
                                            </FooterTemplate>
                                        </asp:TemplateField>

                                       
                                        <asp:TemplateField FooterStyle-HorizontalAlign="Center" HeaderStyle-Width="55" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91" ItemStyle-HorizontalAlign="Center">
                                            <HeaderTemplate>
                                                <asp:Label ID="lblSat" runat="server" Text='<%# GetDate().sat %>'></asp:Label>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="lblIDSat" runat="server" Text='<%# Eval("SIDSat") %>' CssClass="hidden"></asp:Label>
                                                <asp:HiddenField ID="hdSat" runat="server" Value='<%# Eval("ComSat") %>' /> 
                                                <asp:Label ID="lblTimeSat" runat="server" Text='<%# GetDate().sat %>' CssClass="hidden"></asp:Label> 

                                                <asp:TextBox ID="txtTimeReportSat" runat="server" Width="35px" Text='<%# Eval("SatH") %>'></asp:TextBox>
                                                <asp:MaskedEditExtender InputDirection="LeftToRight" ID="MaskedEditExtenderSat" runat="server" TargetControlID="txtTimeReportSat" Enabled="True" Mask="99:99" MaskType="Time" UserTimeFormat="TwentyFourHour"/>
                                                <asp:MaskedEditValidator ID="MaskedEditValidatorSat" runat="server"
                                                ControlExtender="MaskedEditExtenderSat" ControlToValidate="txtTimeReportSat"
                                                ValidationGroup="Register" Display="Dynamic"
                                                InvalidValueMessage="*" IsValidEmpty="True" TooltipMessage="*" CssClass="fail" />
                                            </ItemTemplate>
                                            <FooterTemplate>
                                                <asp:Label ID="lblSumSat" runat="server" Text="0" Font-Bold="True" ForeColor="Maroon"></asp:Label>
                                                
                                            </FooterTemplate>
                                        </asp:TemplateField>

                                        
                                        <asp:TemplateField FooterStyle-HorizontalAlign="Center" HeaderStyle-Width="55" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91" ItemStyle-HorizontalAlign="Center">
                                            <HeaderTemplate>
                                                <asp:Label ID="lblSun" runat="server" Text='<%# GetDate().sun %>'></asp:Label>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="lblIDSun" runat="server" Text='<%# Eval("SIDSun") %>' CssClass="hidden"></asp:Label>
                                                <asp:HiddenField ID="hdSun" runat="server" Value='<%# Eval("ComSun") %>' /> 
                                                <asp:Label ID="lblTimeSun" runat="server" Text='<%# GetDate().sun %>' CssClass="hidden"></asp:Label> 
                                                <asp:TextBox ID="txtTimeReportSun" runat="server" Width="35px" Text='<%# Eval("SunH") %>'></asp:TextBox>
                                                <asp:MaskedEditExtender InputDirection="LeftToRight" ID="MaskedEditExtenderSun" runat="server" TargetControlID="txtTimeReportSun" Enabled="True" Mask="99:99" MaskType="Time" UserTimeFormat="TwentyFourHour"/>
                                                <asp:MaskedEditValidator ID="MaskedEditValidatorSun" runat="server"
                                                ControlExtender="MaskedEditExtenderSun" ControlToValidate="txtTimeReportSun"
                                                ValidationGroup="Register" Display="Dynamic"
                                                InvalidValueMessage="*" IsValidEmpty="True" TooltipMessage="*" CssClass="fail" />
                                            </ItemTemplate>
                                            <FooterTemplate>
                                                <asp:Label ID="lblSumSun" runat="server" Text="0" Font-Bold="True" ForeColor="Maroon"></asp:Label>
                                                
                                            </FooterTemplate>
                                        </asp:TemplateField>

                                        
                                        <asp:TemplateField FooterStyle-HorizontalAlign="Center" HeaderStyle-Width="45" HeaderText="Xóa" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:CheckBox ID="cbDelete" runat="server" />
                                            </ItemTemplate>
                                            <FooterTemplate>
                                                <asp:Label ID="lblSum" runat="server" Text="0" Font-Bold="True" ForeColor="Maroon"></asp:Label>
                                            </FooterTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                        <br />
                        <asp:Label ID="lblComment" runat="server" CssClass="hidden"></asp:Label><br />
                        <asp:TextBox ID="txtComment" runat="server" Width="60%" CssClass="hidden" onblur="document.getElementById(RelatedTextBox).value=document.getElementById('MainContent_txtComment').value;"></asp:TextBox>
                        <br />
                        <asp:Label ID="lblErrorNotice" runat="server" CssClass="error"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <asp:Button ID="btnCopy" runat="server" Text="Sao chép công việc tuần truớc" 
                                CssClass="mybutton color-yellow" onclick="btnCopy_Click" />&nbsp;&nbsp;<asp:Button 
                                ID="btnUpdate" runat="server" Text="Cập nhật" CssClass="mybutton" 
                                onclick="btnUpdate_Click" CausesValidation="False" />
                        </td>
                    </tr>
                </table>
            </div>
        <asp:UpdateProgress ID="UpdateProgress1" runat="server">
            <ProgressTemplate>
                <div class="loading">
                    Đang xử lý <img src="../resources/img/icons/loading.gif" style="width: 31px; height: 31px" alt="Loading" />
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
    
 </form>
</asp:Content>
